package com.itbaizhan.service;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.sql.Connection;
import java.sql.DriverManager;
@Configuration
public class JdbcConfig {
    @Bean
    public Connection getConnection(){
        try{
            Class.forName("com.mysql.jdbc.Driver");
            return DriverManager.getConnection("jdbc:mysql://localhost:3306/student","root","hua8503176");
        }catch (Exception e){
            return null;
        }
    }
}
